package com.ruoyi.service.service.impl;

import java.util.HashMap;
import java.util.List;

import com.ruoyi.service.domain.TongJi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.service.mapper.ServiceDetailsMapper;
import com.ruoyi.service.domain.ServiceDetails;
import com.ruoyi.service.service.IServiceDetailsService;

/**
 * 服务详情Service业务层处理
 * 
 * @author wsc
 * @date 2025-05-09
 */
@Service
public class ServiceDetailsServiceImpl implements IServiceDetailsService 
{
    @Autowired
    private ServiceDetailsMapper serviceDetailsMapper;

    /**
     * 查询服务详情
     * 
     * @param id 服务详情主键
     * @return 服务详情
     */
    @Override
    public ServiceDetails selectServiceDetailsById(Long id)
    {
        return serviceDetailsMapper.selectServiceDetailsById(id);
    }

    /**
     * 查询服务详情列表
     * 
     * @param serviceDetails 服务详情
     * @return 服务详情
     */
    @Override
    public List<ServiceDetails> selectServiceDetailsList(ServiceDetails serviceDetails)
    {
        return serviceDetailsMapper.selectServiceDetailsList(serviceDetails);
    }

    /**
     * 新增服务详情
     * 
     * @param serviceDetails 服务详情
     * @return 结果
     */
    @Override
    public int insertServiceDetails(ServiceDetails serviceDetails)
    {
        return serviceDetailsMapper.insertServiceDetails(serviceDetails);
    }

    /**
     * 修改服务详情
     * 
     * @param serviceDetails 服务详情
     * @return 结果
     */
    @Override
    public int updateServiceDetails(ServiceDetails serviceDetails)
    {
        return serviceDetailsMapper.updateServiceDetails(serviceDetails);
    }

    /**
     * 批量删除服务详情
     * 
     * @param ids 需要删除的服务详情主键
     * @return 结果
     */
    @Override
    public int deleteServiceDetailsByIds(Long[] ids)
    {
        return serviceDetailsMapper.deleteServiceDetailsByIds(ids);
    }

    /**
     * 删除服务详情信息
     * 
     * @param id 服务详情主键
     * @return 结果
     */
    @Override
    public int deleteServiceDetailsById(Long id)
    {
        return serviceDetailsMapper.deleteServiceDetailsById(id);
    }

    @Override
    public List<TongJi> selectServiceDetailsCount(Long id) {
        List<TongJi> tongJis = serviceDetailsMapper.selectServiceDetailsCount(id);
        for (TongJi tongJi : tongJis) {
            System.out.println("tongJi = " + tongJi);
        }
        return tongJis;
    }

    @Override
    public List<HashMap<Integer, Object>> selectServiceDetailsCountByMap(Long id) {
        List<HashMap<Integer, Object>> list = serviceDetailsMapper.selectServiceDetailsCountByMap(id);
        return list;
    }
}
